package club.vann.kafka.mock.service;

import club.vann.kafka.mock.kafka.KafkaProducer;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
public class QuoteMarketDataService {
  private final KafkaProducer kafkaProducer;

  /** 推送报价结果。 */
  public void publish() {
    String ticker = "BTC/USDT";
    //    QuoteOuterClass.Quote.QuoteMarketMonitorSnapshot quoteMarketMonitorSnapshot = of(ticker);
    //    this.kafkaProducer.send(
    //        KafkaTopicFactory.QUOTE_MARKET_OUTPUT, ticker,
    // quoteMarketMonitorSnapshot.toByteArray());
  }

  //  private QuoteOuterClass.Quote.QuoteMarketMonitorSnapshot of(String ticker) {
  //    return QuoteOuterClass.Quote.QuoteMarketMonitorSnapshot.newBuilder()
  //        .setSymbol("BTC/USDT-BINANCE_SPOT-QuoteMarketMonitorAlpha-0b35044e")
  //        .setErrorCode(FrameWorkUtil.ofErrorCode(Framework.DataStatus.Green))
  //        .setTimestamp(FrameWorkUtil.ofTimestampRecord())
  //        .setTicker(ticker)
  //        .setAdv(0.001)
  //        .setLimitPrice(FrameWorkUtil.ofBidAsk(0.001, 0.002))
  //        .setLimitQuantity(FrameWorkUtil.ofBidAsk(0.002, 0.003))
  //        .setMktPrice(FrameWorkUtil.ofBidAsk(60486.0, 60486.01))
  //        .setVenue("BINANCE_SPOT")
  //        .build();
  //  }
}
